#include<stdio.h>
#define LEN 8

int a[LEN] = {1, 2, 4, 5, 3, 2, 1, 8};

int find_least(int start, int end)
{
  if (end > start){
    int mid = start + (end - start) / 2;
    int group1 = find_least(start, mid);
    int group2 = find_least(mid + 1, end);

    return group1 < group2 ? group1 : group2;
  }
  else{
    return a[start];
  }
}

int main()
{
  printf("%d\n", find_least(0, 7));
  return 0;
}
